/******************************************************************************
 * @file  multi_role.h
 *
 * @description Definitions and prototypes for the multi_role example
 *
 *
 Copyright (c) 2013-2016, Texas Instruments Incorporated
 All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:

 *  Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.

 *  Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

 *  Neither the name of Texas Instruments Incorporated nor the names of
    its contributors may be used to endorse or promote products derived
    from this software without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *****************************************************************************/

#ifndef MULTIROLE_H
#define MULTIROLE_H

#ifdef __cplusplus
extern "C"
{
#endif

/*********************************************************************
 * INCLUDES
 */

/*********************************************************************
*  EXTERNAL VARIABLES
*/

/*********************************************************************
 * CONSTANTS
 */

/*********************************************************************
 * MACROS
 */

/*********************************************************************
 * FUNCTIONS
 */

///* Actions for Menu: Init - Scan */
//extern bool mr_doScan(uint8 index);
//
///* Actions for Menu: Init - Connect */
//extern bool mr_doConnect(uint8 index);
//
///* Actions for Menu: Init - GATT R/W */
//extern bool mr_doGattRw(uint8 index);
//
///* Actions for Menu: Init - Conn Update */
//extern bool mr_doConnUpdate(uint8 index);
//
///* Actions for Menu: Init - Disconnect */
//extern bool mr_doDisconnect(uint8 index);
//
///* Actions for Menu: Init - Advertise */
//extern bool mr_doAdvertise(uint8 index);

/*
 * Task creation function for the Simple Peripheral.
 */
extern void multi_role_createTask(void);

/*
 * Notify the ble data
 * */
extern void Multi_SingleNotify(void);

extern signed char mr_turnOnNotify(unsigned short conhdl, \
                      unsigned short notifyhdl);

extern signed char mr_WriteData(unsigned short conhdl, \
                    unsigned short writehdl, 
                      unsigned char *data, unsigned short len);

extern void Multi_BLE_DoSend(void);
extern void Multi_BLE_DoConnect(void);
extern void Multi_BLE_DoConnect_Search(void);
extern void Multi_BLE_DoDisconnect(void);

//!!These function must run in thread
extern signed char Multi_Connect_MAC_MACType(unsigned char *mac, unsigned char type);
extern signed char Multi_Disconnect(unsigned short hdl);
/*********************************************************************
*********************************************************************/

#ifdef __cplusplus
}
#endif

#endif /* MULTIROLE_H */
